
/*
 *
 *  * Copyright (c) 2016. For Intelligent Group.
 *
 */
package com.intelligent.ispc.client.ex.dynamictable;

import javax.swing.table.AbstractTableModel;
import java.util.List;

/**
 * Created by Ethan.Yang on 16/10/21.
 */

/**
 * To define abstract dynamic model of the form
 * @param <T>Generic data
 */
public abstract class DyAbstractTableModel<T> extends AbstractTableModel implements DyTableModel<T> {

    /**
     * Constructor.
     */
    public DyAbstractTableModel() {
    }

    /**
     * Returns the number of columns in the model
     * <code>JTable</code> uses this method to determine how many columns it
     * @return the number of columns in the model
     */
    public abstract int getColumnCount();

    /**
     * Returns the number of rows in the model.
     * <code>JTable</code> uses this method to determine how many rows it
     * @return the number of rows in the model
     */
    public abstract int getRowCount();

    /**
     *  Returns the most specific superclass for all the cell values
     * in the column.  This is used by the <code>JTable</code> to set up a
     * default renderer and editor for the column.
     * @param col  the index of the column
     * @return the name of the column
     */
    public abstract String getColumnName(int col);

    /**
     *Returns the value for the cell at <code>col</code> and
     * <code>row</code>.
     * @param row the row whose value is to be queried
     * @param col the column whose value is to be queried
     * @return the value Object at the specified cell
     */
    public abstract Object getValueAt(int row, int col);

    @Override
    public abstract List getData();

    @Override
    public abstract void setData(List<T> data);
}
